//
//  LHProvinceCollectionViewCell.m
//  Knight_Tour
//
//  Created by Bruce_Lin on 15/5/15.
//  Copyright (c) 2015年 TouchOne. All rights reserved.
//

#import "LHProvinceCollectionViewCell.h"
#import "LHProvinceModel.h"

@implementation LHProvinceCollectionViewCell

- (void)dealloc
{
    [_picView release];
    [_privinceName release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame 
{
    if (self = [super initWithFrame:frame]) {
        
        [self creatView];
    }
    return self;
}

- (void)creatView
{
    self.picView = [[UIImageView alloc]init];
    [self.contentView addSubview:_picView];
    [_picView release];
    
    self.privinceName = [[UILabel alloc]init];
    _privinceName.textColor = [UIColor colorWithRed:0.383 green:0.719 blue:0.904 alpha:1.000];
    _privinceName.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_privinceName];
    [_privinceName release];

}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [_picView setFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - 20)];    
    [_privinceName setFrame:CGRectMake(self.frame.size.width / 2 - 30, _picView.frame.size.height + 5, 60, 20)];
}

@end
